﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace DaInterFace.PDA
{
    public interface IPDA
    {
        event PDAMessageHandler MessageEvent;

        IDataBase Data { get; }

        ISerialApi SerialApi { get; }

        IConfig Config { get; }
        void Message(MessageType type, String note);
        void Message(MessageType type, String note, Double span);
    }

    public class LoginResult
    {
        public Boolean Enable;
        public String Message;
        public String Key;
        public String UserType;
        public String UserNumber;
        public String UserName;
        public int VistSpan;
    }

    public enum EnumResult : int
    { 
        Normal=0,
        Error=1,
        ReLoad=2
    }

    public class LoginParameters
    {
        public String UserNumber;
        public String PassWord;
        public String IMEI;
    }

    // 客户端访问用
    public class PDAClient
    {
        public String UserNumber;
        public String IMEI;
        public String Key;
    }
    
    //Code内管理用户用 保护MobileUser 部分敏感内容
    public class PDACodeUser
    {
        public String UserName;
        public String UserNumber;
        public DateTime LoginTime;
        public DateTime VisitTime;
    }

    public class CodeResult
    {
        public EnumResult Result;
        public String Message;
        public String Content;
        public SerialType SerialType;
    }

    public class PDAParameter
    {
        public String CodeName;
        public PDAClient Client;
        public String Parameters;
    }

    public interface IPDAChild
    {
        void Code(IPDA handler,CodeResult result, PDACodeUser user, String parameter);
    }

    public delegate void PDAMessageHandler(MessageType type, String note, Double span);
}
